import Counter from '../components/Counter';
import { connect } from 'react-redux';

import {
  createIncrementAction,
  createDecrementAction,
  createIncrementAsyncAction,
} from '../redux/countAction';
const mapStateToProps = state => ({
  count: state,
});

const mapDispatchToProps = dispatch => ({
  increment: step => dispatch(createIncrementAction(step)),
  decrement: step => dispatch(createDecrementAction(step)),
  incrementAsync: (step, time) =>
    dispatch(createIncrementAsyncAction(step, time)),
});

// eslint-disable-next-line react-refresh/only-export-components
export default connect(mapStateToProps, mapDispatchToProps)(Counter);
